﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Vergnaty.Repository
{
    public interface IRepository<TEntity> 
        where TEntity : class
    {
        /// <summary>
        /// Add TEntity
        /// </summary>
        /// <param name="entity">the Entity</param>
        /// <returns>TEntity</returns>
        TEntity Add(TEntity entity);

        /// <summary>
        /// Get TEntity by id
        /// </summary>
        /// <param name="id">the id</param>
        /// <returns>TEntity</returns>
        TEntity GetById(Guid id);

        /// <summary>
        /// Update Entity
        /// </summary>
        /// <param name="entity">the Entity</param>
        /// <returns>TEntity</returns>
        TEntity Update(TEntity entity);
        /// <summary>
        /// Delete TEntity by id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        void Delete(Guid id);

        /// <summary>
        /// Get list of TEntity
        /// </summary>
        /// <returns></returns>
        IList<TEntity> GetList(TEntity filter);
    }
}
